package com.tanger.es;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @Description TODO
 * @Author Hchenbin
 * @Date 2024-01-08 09:23
 * @Version 1.0
 */
@Data
public class ESNamed {

    @Field(type = FieldType.Keyword, store = true)
    private String id;
    @Field(type = FieldType.Text, analyzer = "analyzer_ngram", searchAnalyzer = "analyzer_ngram_search")
    private String name;
    @Field(type = FieldType.Text, analyzer = "analyzer_standard", searchAnalyzer = "analyzer_standard")
    private String nameEn;
    @Field(type = FieldType.Text, analyzer = "analyzer_ngram", searchAnalyzer = "analyzer_ngram_search")
    private String code;

    public ESNamed(String id, String name, String nameEn, String code) {
        this.id = id;
        this.name = name;
        this.nameEn = nameEn;
        this.code = code;
    }

    public ESNamed(String name, String nameEn, String code) {
        this.name = name;
        this.nameEn = nameEn;
        this.code = code;
    }

    public ESNamed() {
    }
}
